﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Customer/CustomerMaster.Master" AutoEventWireup="true" CodeBehind="Billing.aspx.cs" Inherits="SupermarketDemo.Views.Customer.Billing" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        function PrintBill() {
            var PGrid = document.getElementById('<%=ShoppingCartList.ClientID%>');
            PGrid.bordr = 0;
            var PWin = window.open('', 'PrintGrid', 'left=100,top=100,width=1024,height=768,tollbar=0,scrollbars=1,status=0,resizable=1');
            PWin.document.write(PGrid.outerHTML);
            PWin.document.close();
            Pwin.focus();
            PWin.print();
            PWin.close();
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MyContent" runat="server">
    <div class="container-fluid">
        <div class="row">
        </div>
        <div class="row">
            <div class="col-md-5">
                <h3 class="text-center" style="color: teal">商品选购</h3>
                <div class="row">
                    <div class="col">
                        <div class="mt-3">
                            <label for="" class="form-label text-success">商品名称</label>
                            <input type="text" placeholder="" autocomplete="off" runat="server" class="form-control" id="PnameTb" />
                        </div>
                    </div>
                    <div class="col">
                        <div class="mt-3">
                            <label for="" class="form-label text-success">价格</label>
                            <input type="text" placeholder="" autocomplete="off" runat="server" class="form-control" id="PriceTb" />
                        </div>
                    </div>
                    <div class="col">
                        <div class="mt-3">
                            <label for="" class="form-label text-success">数量</label>
                            <input type="text" placeholder="" autocomplete="off" runat="server" class="form-control" id="QtyTb" />
                        </div>
                    </div>
                    <div class="row mt-3 md-3">
                        <div class="col d-grid">
                            <asp:Button Text="加入购物车" runat="server" ID="AddToBillBtn" class="btn-warning btn-block btn" OnClick="AddToBillBtn_Click" />
                        </div>
                    </div>
                </div>
                <div class="row mt-5">
                    <h4 class="text-center" style="color: teal">商品列表</h4>
                    <div class="col">
                        <asp:GridView ID="ProductList" class="table" runat="server" AutoGenerateSelectButton="true" OnSelectedIndexChanged="ProductList_SelectedIndexChanged"></asp:GridView>
                    </div>
                </div>
            </div>
            <div class="col-md-7">
                <h4 class="text-center" style="color: firebrick">购物车</h4>
                <div class="col">
                    <asp:GridView ID="ShoppingCartList" class="table" runat="server" AutoGenerateSelectButton="false" OnSelectedIndexChanged="ProductList_SelectedIndexChanged"></asp:GridView>
                    <div class="row">
                        <div class="row">
                            <div class="col-md-3">

                            </div>
                            <div class="col md-1">
                                <asp:Label runat="server" ID="RMBLabel" class="text-danger text-center"></asp:Label><br />
                            </div>
                            <div class="col md-6">
                                <asp:Label runat="server" ID="GrdTotalTb" class="text-danger text-center"></asp:Label><br />
                            </div>
                        </div>
                        <div class="row">
                            <asp:Button Text="结算" ID="PrintBtn" OnClientClick="PrintBill()" runat="server" Class="btn-warning btn-block btn" OnClick="PrintBtn_Click" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
